package ZoneId_Demo;

import java.time.LocalDate;
import java.util.Calendar;

public class Test05 {
    public static void main(String[] args) {
        //jdk7
        Calendar calendar = Calendar.getInstance();
        calendar.set(2001,2,-1);
        calendar.add(Calendar.DAY_OF_MONTH,1);
        int day1 = calendar.get(Calendar.DAY_OF_MONTH);
        System.out.println(day1);

        //jdk8
        LocalDate localDate = LocalDate.of(2001,3,1);
        LocalDate localDate1 = localDate.minusDays(1);
        int day2 = localDate1.getDayOfMonth();
        System.out.println(day2);


        //jdk8  直接判断闰年

        System.out.println(localDate.isLeapYear());
    }
}
